package com.hex.ds.hdrs.cron.dto;

import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
public class CronTaskDefDto {

    private String pkId;

    private String taskCode;

    private String taskCodeFuzzy;

    private String taskName;

    private String taskDesc;

    private String taskStatus;

    private String cronExpress;

    private String appCode;

    private Integer resNum;

    private String appointAgentCode;

    private String taskStDate;

    private String taskEndDate;

    private String isValidDate;

    private String batchTag;

    private String shellPath;

    private String extParam;

    private String planExecDuration;

    private String overPlanDuration;

    private String startEndDateStr;

    private List<String> pkIds;

    private String taskCodeAndName;

    public String getStartEndDateStr() {
        if ("1".equals(isValidDate) && (StrUtil.isNotBlank(taskStDate) && StrUtil.isNotBlank(taskEndDate))) {
            return taskStDate + "~" + taskEndDate;
        }
        return null;
    }
}
